-- GENERATED SPELL FOR [Rockwing Screecher] --


function spell0_10409(pUnit, Event) --@Demoralizing Shout,Self--
pUnit:FullCastSpellOnTarget(13730,pUnit)
pUnit:RegisterEvent('Sorts_10409', 30273, 1)
end

function spell1_10409(pUnit, Event) --@Gargoyle Strike,n/a--
pUnit:FullCastSpellOnTarget(16997,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10409', 1500, 1)
end

function spell2_10409(pUnit, Event) --@Terrifying Howl,Self--
pUnit:FullCastSpellOnTarget(8715,pUnit)
pUnit:RegisterEvent('Sorts_10409', 3000, 1)
end

function Sorts_10409(pUnit, Event)
local choix_sorts_10409 = math.random(0, 2)
if choix_sorts_10409 == 0 then
pUnit:RegisterEvent('spell0_10409', 1, 1)
end
if choix_sorts_10409 == 1 then
pUnit:RegisterEvent('spell1_10409', 1, 1)
end
if choix_sorts_10409 == 2 then
pUnit:RegisterEvent('spell2_10409', 1, 1)
end
end

function mob10409_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_10409', math.random(1500, 3000), 1)
end

function mob10409_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob10409_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob10409_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(10409, 1, 'mob10409_Action')
RegisterUnitEvent(10409, 2, 'mob10409_Leave')
RegisterUnitEvent(10409, 3, 'mob10409_Kill')
RegisterUnitEvent(10409, 4, 'mob10409_Die')
